package TEST3;


    import java.util.*;
    public class Car {
        private final String name;
        private final String type;
        public Car(String name, String type){
            this.name = name;
            this.type = type;
        }
        public String getName() { return this.name; }
        public String getType() { return this.type; }
        public String toString() { return String.format("Car[name:%s, type:%s]", name, type);}
        public static void main(String args){
            List<Car> cars = new ArrayList<Car>();
            cars.add(new Car("AAA","CCC"));
            cars.add(new Car("KKK","DSS"));
            for(Car car : cars){
                System.out.println(car);
            }
        }
    }
